package com.mspbots.core.ticketai;


import com.mspbots.core.ticketai.model.Agreements;
import com.mspbots.core.ticketai.service.AgreementsService;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.concurrent.Callable;

/**
 * com.mspbots.sync.wise.controller.BoardController
 *
 * @author Alex bob(https://github.com/vnobo)
 * @date Created by 2019/11/13
 */
@Log4j2
@RestController
@RequiredArgsConstructor
@RequestMapping("agreements")
public class AgreementsController {

    private final AgreementsService agreementsService;

    @GetMapping("queryareements")
    public Callable<List<Agreements>> queryareements(@RequestParam Long tenantId, Long companyId) {
        Assert.notNull(tenantId, "Query params tenantId not null");
        return () -> this.agreementsService.queryareements(tenantId, companyId);
    }


}
